﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using BrainTechLLC;
using SimpleFileDataAndViewModels;

namespace SimpleImageApplication
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public static App TheApp;
        public static ICoreDataProvider DataProvider;

        public App()
        {
            if (TheApp != null)
            {
                return;
            }

            DataProvider = new DiskDataProvider();
            HasBytes.DefaultDataProvider = DataProvider;

            this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
            TheApp = this;
        }

        void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.Exception.ToString());
        }

    }
}
